#
# Copyright 2024 Kumo.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
# below are examples, after initialization, modify it to your own.
###########################################################################
###kmcmake_example
kmcmake_cc_object(
        NAMESPACE krpc
        NAME kutil_obj
        SOURCES
        ${KUTIL_SOURCES}
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
)

kmcmake_cc_object(
        NAMESPACE krpc
        NAME source_obj
        DEPS
        proto_obj
        SOURCES
        ${SOURCES}
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
)

kmcmake_cc_library(
        NAMESPACE ${PROJECT_NAME}
        NAME krpc
        OBJECTS
        proto_obj kutil_obj source_obj
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        ${KMCMAKE_DEPS_LINK}
        PUBLIC
)

kmcmake_cc_interface(
        NAMESPACE ${PROJECT_NAME}
        NAME version
        HEADERS
        version.h
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        PUBLIC
)

kmcmake_cc_binary(
        NAMESPACE ${PROJECT_NAME}
        NAME protoc-gen-mcpack
        SOURCES
        ${PROJECT_SOURCE_DIR}/krpc/mcpack2pb/generator.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        DEPS
        krpc::krpc_static
        LINKS
        krpc::krpc_static
        ${KMCMAKE_DEPS_LINK}
        PUBLIC
)
if(BUILD_RPC_TOOLS)
add_subdirectory(tools/benchmark_http)
add_subdirectory(tools/parallel_http)
#add_subdirectory(tools/rpc_press)
#add_subdirectory(tools/rpc_replay)
add_subdirectory(tools/rpc_view)
add_subdirectory(tools/trackme_server)
endif ()
###kmcmake_example